package cn.fastoo.common.entity.system;

import cn.fastoo.common.sampleframe.entity.BaseEntity;
import com.alibaba.fastjson.annotation.JSONField;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.List;

/**
 * 角色.
 * 
 * @author LP
 */
@Table(name = "admin_system_role")
public class Role extends BaseEntity {
	private static final long serialVersionUID = 1L;
	/**
	 * 超级管理员(*.*)数据库id
	 */
	public static Long SUPER_ADMIN_ID = 1L;
	/** 角色字符：必须为英文，用于系统识别 */
	@Column(name="role")
	private String role;
	/** 角色名称：通常为中文，用于用户识别 */
	@Column(name="name")
	private String name;
	/** 角色描述 */
	@Column(name="description")
	private String description;
	@Column(name="permission_ids")
	private String permissionIds;
 

	private List<Role> roleList = new ArrayList<Role>();
	
	private List<Permission> permissionList = new ArrayList<Permission>();

	public Role(){
		
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	 


	@JSONField(serialize=false)
	public List<Role> getRoleList() {
		return roleList;
	}

	public void setRoleList(List<Role> roleList) {
		this.roleList = roleList;
	}
	@Transient
	public List<Permission> getPermissionList() {
		return permissionList;
	}

	public void setPermissionList(List<Permission> permissionList) {
		this.permissionList = permissionList;
	}


	public String getPermissionIds() {
		return permissionIds;
	}

	public void setPermissionIds(String permissionIds) {
		this.permissionIds = permissionIds;
	}
}
